package com.aishua.fire.jpa;


import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import com.aishua.fire.jpa.entity.TwoLevelMenu;

import java.lang.Long;
import java.util.List;

/**
 * jpa使用
 * @author Administrator
 *
 */
public interface TwoLevelMenuDao extends JpaRepository<TwoLevelMenu, Long>,JpaSpecificationExecutor<TwoLevelMenu> {

	@Transactional
	@Query(value="select t from TwoLevelMenu t where t.twoLevelMenu = ?1")
	TwoLevelMenu findByTwoLevelMenu(String moduleName);

	@Transactional
	@Query(value="select t from TwoLevelMenu t where t.oneLevelId = ?1")
	List<TwoLevelMenu> findByOneLevelId(String oneLevelId);
	
}
